move setup banner after --json early return - #128
Merged
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe PR adjusts when the setup banner is printed so that Sequence diagram for dotagents setup JSON early return and banner printingsequenceDiagram
actor User
participant CLI as dotagents_setup
participant Streams
participant Encoder
User->>CLI: runSetup(opts)
CLI->>Streams: setupStreams(opts)
CLI->>CLI: loadSetupConfig(configPath, home)
CLI->>CLI: detectLlmConfig(cfg, home)
CLI->>CLI: detectRepo(detected)
CLI->>Encoder: enc.Encode(detection)
alt opts.json
Encoder-->>User: JSON detection
note over CLI,Encoder: runSetup returns before banner
else no json flag
CLI->>Streams: Fprintln(out, dotagents setup)
CLI->>Streams: Fprintf(out, config root: repoRoot)
CLI->>CLI: scanNativeImports(cfg, detected, repoRoot, home)
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Consider adding a brief comment near the banner print explaining that it must occur after the
--jsonearly return so future refactors don’t accidentally break JSON output again. - If
dotagents setupoutput is expected to be machine-consumed in other contexts, you might want to gate the banner on an explicit interactive/tty check instead of only the JSON flag to avoid mixing human-readable banners with structured output.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider adding a brief comment near the banner print explaining that it must occur after the `--json` early return so future refactors don’t accidentally break JSON output again.
- If `dotagents setup` output is expected to be machine-consumed in other contexts, you might want to gate the banner on an explicit interactive/tty check instead of only the JSON flag to avoid mixing human-readable banners with structured output.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The setup banner was printed to stdout before the
--jsonearly return, sodotagents setup --jsonoutput was not parseable JSON. Follow-up to #127 (this fix was on the branch but the PR merged before it landed). Part of #126.Summary by Sourcery
Bug Fixes:
--jsonmode so the command output remains parseable JSON.